<%@page import="java.net.URLEncoder"%>
<%@page import="java.util.HashSet"%>
<%@page import="com.swlz.entity.MallType"%>
<%@page import="com.swlz.service.impl.MallTypeServiceImpl"%>
<%@page import="com.swlz.service.MallTypeService"%>
<%@page import="java.util.List"%>
<%@page import="com.swlz.vo.PageVO"%>
<%@page import="com.swlz.dto.MallProductSearch"%>
<%@page import="com.swlz.entity.MallProduct"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%--核心标签库 --%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>搜索页面</title>
		<base href="${pageContext.request.contextPath }/" />
		
  		
  
		<link href="front/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />
		<link href="front/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css" />
		
		<link href="front/basic/css/demo.css" rel="stylesheet" type="text/css" />
		
		<link href="front/css/seastyle.css" rel="stylesheet" type="text/css" />
		
	
		<script type="text/javascript" src="front/basic/js/jquery-1.7.min.js"></script>
		<script type="text/javascript" src="front/js/script.js"></script>
		
		
	</head>

	<body>

		<!--顶部导航条 -->
		<div class="hmtop">
			<!--顶部导航条 -->
			<div class="am-container header">
				<ul class="message-l">
					<div class="topMessage">
						<div class="menu-hd">
							<a href="login1.jsp" target="_top" class="h">你好，请登录</a>
							<a href="register.jsp" target="_top" style="color: #F03726;">免费注册</a>
						</div>
					</div>
				</ul>
				<ul class="message-r">
					<div class="topMessage home">
						<div class="menu-hd"><a href="mall-list.let" target="_top" class="h">商城首页</a></div>
					</div>
					<div class="topMessage my-shangcheng">
						<div class="menu-hd MyShangcheng"><a href="login1.jsp" target="_top"><i class="am-icon-user am-icon-fw" style="color: #F03726;"></i>个人中心</a></div>
					</div>
					<div class="topMessage mini-cart">
						<div class="menu-hd"><a id="mc-menu-hd" href="login1.jsp" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
					</div>
					<div class="topMessage favorite">
						<div class="menu-hd"><a href="login1.jsp" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
				</ul>
				</div>

				<!--悬浮搜索框-->

				<div class="nav white">
					<div class="logoBig">
						<a href="mall-list.let">
						<li><img src="front/images/logobig.png" alt="图片加载中" style="width: 80px; height: 80px; padding-top: 5px;" /><img src="front/images/logo_font.png" alt="图片加载中" style="width: 88px; height: 35px; display: inline-block;"/></li>
						</a>
					</div>

					<div class="search-bar pr">
						<a name="index_none_header_sysc" href="#"></a>
						<form action="search.let" method="get">
							<input id="searchInput" name="key" type="text" placeholder="请输入关键字" autocomplete="off" value="${search.key }">
							<input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
						</form>
					</div>
				</div>

				<div class="clear"></div>
			</div>

			<div class="clear"></div>
			<b class="line"></b>
           <div class="search">
			<div class="search-list">
			<div class="nav-table">
					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
						     <div class="nav-extra">
								<a href="login1.jsp" style="color: #ffffff;font-size: 16px;">
						    	<i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>购物车
								<i class="am-icon-angle-right" style="padding-left: 10px;"></i>
							    </a>
						     </div>
						</div>
			</div>
			
				
					<div class="am-g am-g-fixed">
						<div class="am-u-sm-12 am-u-md-12">
	                  	<div class="theme-popover">														
							
							<ul class="select">
										
								<div class="clear"></div>
								
								
								<li class="select-list">
									<dl id="select3">
								
								
										<dt class="am-badge am-round"><a href="search.let"></a></dt>
								
										<div class="dd-conent">

												<%
								PageVO<MallProduct> mp=	(PageVO<MallProduct>)request.getAttribute("p");											
								MallTypeService mallTypeService = new MallTypeServiceImpl();	
								List<MallType> type=(List<MallType>)request.getAttribute("type");
								for(MallType m:type){
								%>
											<a href="search.let?mallTypeId=<%=m.getMallTypeId() %>&key=${search.key}" ><dd ><%=m.getMallTypeName()%></dd></a>
								<%}%>
										</div>
									</dl>
								</li>
								
					        
							</ul>
							<div class="clear"></div>
                        </div>
							
								<ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 boxes">
								<c:forEach  items="${p.list}" var="p" varStatus="s">
									<li>
										<div class="i-pic limit" ><a href="mall-product.let?productId=${p.productId } " >
										
											<img onerror="this.src='assets/img/no-img.png'"
											src="${p. productImgs}"/>											
											<p class="title fl">${p.productName }</p>
									<p class="price fl">
												<b>¥</b>
												<strong>${p.productPrice2 }</strong>
											</p>
											</a>
										</div>
									</li>
									</c:forEach>
										</ul>
							</div>
							<div class="clear"></div>
							

						</div>
						
						
					</div>
					
					 <%
          
					 MallProductSearch search=(MallProductSearch)request.getAttribute("search");
					String url = "search.let?mallTypeId={mallTypeId}&key={key}&pageSize={rowMax}&pageNumber={current}";
					url = url.replace("{rowMax}", mp.getRowMax()+"");
					if(search.getMallTypeId()==null){
					  url = url.replace("{mallTypeId}", "");
					}else{
					  url = url.replace("{roleId}", search.getMallTypeId().toString());
					}
					if(search.getKey()==null){
					  url = url.replace("{key}", "");
					}else{
					  url = url.replace("{key}", URLEncoder.encode(search.getKey(), "UTF-8"));
					}
					%>
					          
					          <ul class="am-pagination am-pagination-right">
					  <li class="page-item"><a class="page-link" href="<%=url.replace("{current}", "1")%>"> <span aria-hidden="true">&laquo;</span></a></li>
					<%for(int i : mp.getPages()) { %>
					  <li class="page-item <%=mp.getCurrent().equals(i)?"am-active":""%>"><a class="page-link" href="<%=url.replace("{current}", i+"")%>"><%=i %></a></li>
					<%} %>
					  <li class="page-item"><a class="page-link" href="<%=url.replace("{current}", mp.getPageMax()+"")%>"> <span aria-hidden="true">&raquo;</span></a></li>
					</ul>
		
					</form>
					
					
					
					
					<div class="footer ">
						<div class="footer-hd ">
							<p>
								<a href="about.let?name=1278551338296279040 ">舒心购</a>
								<b>|</b>
								<a href="mall-list.let">商城首页</a>
							</p>
						</div>
						<div class="footer-bd ">
							<p>
								<a href="about.let?name=1278551338296279040 ">关于舒心购</a>
								<b>|</b>
								<a href="join.let?name=1278551338526965760 ">联系我们</a>
								<b>|</b>
								<em>© 2020-2025 shuxingou.com 版权所有</em>
							</p>
						</div>
					</div>
				</div>

			</div>

		<!--引导 -->
		<div class="navCir">
			<li><a href="home.html"><i class="am-icon-home "></i>首页</a></li>
			<li><a href="sort.html"><i class="am-icon-list"></i>分类</a></li>
			<li><a href="shopcart.html"><i class="am-icon-shopping-basket"></i>购物车</a></li>	
			<li><a href="front/person/index.html"><i class="am-icon-user"></i>我的</a></li>					
		</div>

		<!--菜单 -->
		<div class=tip>
			<div id="sidebar">
				<div id="wrap">
					<div id="prof" class="item">
						<a href="#">
							<span class="setting"></span>
						</a>
						<div class="ibar_login_box status_login">
							<div class="avatar_box">
								<p class="avatar_imgbox"><img src="front/images/no-img_mid_.jpg" /></p>
								<ul class="user_info">
									<li>用户名：sl1903</li>
									<li>级&nbsp;别：普通会员</li>
								</ul>
							</div>
							<div class="login_btnbox">
								<a href="#" class="login_order">我的订单</a>
								<a href="#" class="login_favorite">我的收藏</a>
							</div>
							<i class="icon_arrow_white"></i>
						</div>

					</div>
					<div id="shopCart" class="item">
						<a href="#">
							<span class="message"></span>
						</a>
						<p>
							购物车
						</p>
						<p class="cart_num">0</p>
					</div>
					<div id="asset" class="item">
						<a href="#">
							<span class="view"></span>
						</a>
						<div class="mp_tooltip">
							我的资产
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div id="foot" class="item">
						<a href="#">
							<span class="zuji"></span>
						</a>
						<div class="mp_tooltip">
							我的足迹
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div id="brand" class="item">
						<a href="#">
							<span class="wdsc"><img src="front/images/wdsc.png" /></span>
						</a>
						<div class="mp_tooltip">
							我的收藏
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div id="broadcast" class="item">
						<a href="#">
							<span class="chongzhi"><img src="front/images/chongzhi.png" /></span>
						</a>
						<div class="mp_tooltip">
							我要充值
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div class="quick_toggle">
						<li class="qtitem">
							<a href="#"><span class="kfzx"></span></a>
							<div class="mp_tooltip">客服中心<i class="icon_arrow_right_black"></i></div>
						</li>
						<!--二维码 -->
						<li class="qtitem">
							<a href="#none"><span class="mpbtn_qrcode"></span></a>
							<div class="mp_qrcode" style="display:none;"><img src="../images/weixin_code_145.png" /><i class="icon_arrow_white"></i></div>
						</li>
						<li class="qtitem">
							<a href="#top" class="return_top"><span class="top"></span></a>
						</li>
					</div>

					<!--回到顶部 -->
					<div id="quick_links_pop" class="quick_links_pop hide"></div>

				</div>

			</div>
			<div id="prof-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					我
				</div>
			</div>
			<div id="shopCart-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					购物车
				</div>
			</div>
			<div id="asset-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					资产
				</div>

				<div class="ia-head-list">
					<a href="#" target="_blank" class="pl">
						<div class="num">0</div>
						<div class="text">优惠券</div>
					</a>
					<a href="#" target="_blank" class="pl">
						<div class="num">0</div>
						<div class="text">红包</div>
					</a>
					<a href="#" target="_blank" class="pl money">
						<div class="num">￥0</div>
						<div class="text">余额</div>
					</a>
				</div>

			</div>
			<div id="foot-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					足迹
				</div>
			</div>
			<div id="brand-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					收藏
				</div>
			</div>
			<div id="broadcast-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					充值
				</div>
			</div>
		</div>
		<script>
			window.jQuery || document.write('<script src="basic/js/jquery-1.9.min.js"><\/script>');
		</script>
		<script type="text/javascript" src="front/basic/js/quick_links.js"></script>

<div class="theme-popover-mask"></div>

	</body>

</html>
